#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main() {
	int n, i, j;
	scanf("%d", &n);
	int a[10][10] = { 0 };
	for (i = 0; i < n; i++) {
		for (j = 0; j <= i; j++) {
			if (j == 0 || j == i) a[i][j] = 1;
			else a[i][j] = a[i - 1][j - 1] + a[i - 1][j];
		}
	}
	for (i = 0; i < n; i++) {
		for (j = 0; j <= i; j++) {
			printf("%d", a[i][j]);
		}

	}
	for (i = 0; i < n; i++) {
		for (j = n - 1 - i; j > 0; j--)
			printf(" ");
		for (j = 0; j <= i; j++)
			printf("%4d", a[i][j]);
		putchar('\n');
	}
	return 0;
}